


        var mobileStart;
        var mouseStart;
        function makeInterval(el){
            var index = el.ind;
            el.timeOut = function(){
                setTimeout(function(){
                    if(el.innerText != nums[index]){
                        el.time = parseInt(600 / (nums[index] - el.innerText));
                        setTimeout(function(){
                            el.innerText = String(Number(el.innerText) + 1);
                            el.timeOut();
                        },el.time);
                    }
                },10);
            }
            el.timeOut();
        }
        

        function updateHonor(){
            /*var index = $(this)[0].ind;
                if(index == 0 || index == $('main .honors .box .ruler .yearPalace .yy').length - 1) return false;
                var moveLeft = $(this)[0].left >= $(this)[0].ind * 50
                for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                    var newLeft = parseFloat($('main .honors .box .ruler .yearPalace .yy')[l].style.left);
                    $('main .honors .box .ruler .yearPalace .yy')[l].left = newLeft;
                }*/
            var year = $('main .honors .box .ruler .months .current .num').text().split('.')[0];
            if(year != $('main .honors .box .ruler .yearPalace .current').text()){
                for(var c = 0;c < $('main .honors .box .ruler .yearPalace .yy').length;c++){
                    if($('main .honors .box .ruler .yearPalace .yy')[c].innerText == year){
                        currentYearInd = c;
                        $('main .honors .box .ruler .yearPalace .current').removeClass('current');
                        $('main .honors .box .ruler .yearPalace .yy:eq(' + currentYearInd + ')').addClass('current');
                        if(currentYearInd != 0 && currentYearInd != $('main .honors .box .ruler .yearPalace .yy').length - 1){
                            //var moveLeft = $('main .honors .box .ruler .yearPalace .yy')[c].left >= 50;
                            var moveVal = -($('main .honors .box .ruler .yearPalace .yy')[c].left - 50);
                            //($('main .honors .box .ruler .yearPalace .yy')[c].left - 50);
                            console.log(moveVal);
                            for(var n = 0;n < $('main .honors .box .ruler .yearPalace .yy').length;n++){
                                var newLeft = parseFloat($('main .honors .box .ruler .yearPalace .yy')[n].style.left) + moveVal;
                                $('main .honors .box .ruler .yearPalace .yy')[n].left = newLeft;
                                $('main .honors .box .ruler .yearPalace .yy')[n].style.left = newLeft + '%';
                            }
                            $('main .honors .box .ruler .yearPalace')[0].left += moveVal;
                        };
                        /*var rulerYearLeft = $('main .honors .box .ruler .yearPalace .current')[0].getBoundingClientRect().left;
                        if(rulerYearLeft > $('main .honors .box .ruler .yearPalace')[0].offsetWidth / 2 + window.innerWidth / 2){
                            $('main .honors .box .ruler .yearPalace')[0].left -= 28;
                            $('main .honors .box .ruler .yearPalace')[0].style.left = $('main .honors .box .ruler .yearPalace')[0].left + '%';
                        }else if(rulerYearLeft < (window.innerWidth - $('main .honors .box .ruler .yearPalace')[0].offsetWidth) / 2){
                            $('main .honors .box .ruler .yearPalace')[0].left += 28;
                            $('main .honors .box .ruler .yearPalace')[0].style.left = $('main .honors .box .ruler .yearPalace')[0].left + '%';
                        }*/
                        break;
                    }
                }
            }
            var yearMonth = $('main .honors .box .ruler .months .current .num').text();
            if(currentMonthInd == 0){
                    $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext').addClass('start');
                    $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .prev .val')[0].innerHTML = yearMonth;
            }else{
                $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext').removeClass('start');
                $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .prev .val')[0].innerHTML = $('main .honors .box .ruler .months .current').prev().find('.num').text();
            }
            if(currentMonthInd == $('main .honors .box .ruler .months .item').length - 1){
                    $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext').addClass('end');
                    $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .next .val')[0].innerHTML = yearMonth;
            }else{
                $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext').removeClass('end');
                $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .next .val')[0].innerHTML = $('main .honors .box .ruler .months .current').next().find('.num').text();
            }
            $('main .honors .box .contn .mainContnt .details .year').html(yearMonth);
            $('main .honors .box .contn .mainContnt .details .intro p').removeClass('current');
            $('main .honors .box .contn .mainContnt .details .intro p:eq(' + currentMonthInd + ')').addClass('current');
            $('main .honors .picPalace img').removeClass('current');
            $('main .honors .picPalace img:eq(' + currentMonthInd + ')').addClass('current');
            $('main .honors .box .contn .lgNum').html(year);
        }
        var currentYearInd = 0;
        var currentMonthInd = 0;
        for(var y = 0;y < $('main .honors .box .ruler .yearPalace .yy').length;y++){
            $('main .honors .box .ruler .yearPalace .yy')[y].ind = y;
        }
        for(var m = 0;m < $('main .honors .box .ruler .months .item').length;m++){
            $('main .honors .box .ruler .months .item')[m].ind = m;
        }

        $(document).ready(function(){
            for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                $('main .honors .box .ruler .yearPalace .yy')[l].style.left = (l + 1) * 28 + '%';
                $('main .honors .box .ruler .yearPalace .yy')[l].left = (l + 1) * 28;
                $('main .honors .box .ruler .yearPalace .yy')[l].ind = l;
            }
            $('main .honors .box .ruler .yearPalace .yy').css('transition','ease .3s left')
            var leftMax;
            if($('main .honors .box .ruler .yearPalace .yy').length > 3){
               leftMax = ($('main .honors .box .ruler .yearPalace .yy').length - 3) * 28;
            }
            //$('main .honors .box .ruler .yearPalace').attr('canMove','true');
            $('main .honors .box .ruler .yearPalace')[0].left = parseFloat($('main .honors .box .ruler .yearPalace').css('left'));
            $('main .honors .box .ruler').mousedown(function(e){
                $('main .honors .box .ruler .yearPalace').attr('canmove','true');
                var se = e || window.event;
                mouseStart = se.clientX;
                console.log(mouseStart);
                $(document).mousemove(function(eve){
                    if($('main .honors .box .ruler .yearPalace .yy').length <= 3) return false;
                    if($('main .honors .box .ruler .yearPalace').attr('canmove') != 'true') return false;
                    var me = eve || window.event;
                    var current = me.clientX;
                    var distance = current - mouseStart;
                    var val = distance / $('main .honors .box .ruler .yearPalace')[0].offsetWidth * 100;
                    console.log(mouseStart,current,parseInt(val));
                    if($('main .honors .box .ruler .yearPalace')[0].left + val < - leftMax){
                        val = -leftMax;
                        return false;
                    }else if($('main .honors .box .ruler .yearPalace')[0].left + val > 0){
                        val = 0;
                        return false;
                    }
                    for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                        var oriLeft = $('main .honors .box .ruler .yearPalace .yy')[l].left;
                        $('main .honors .box .ruler .yearPalace .yy')[l].style.left = (oriLeft + val) + '%';
                    }
                    //$('main .honors .box .ruler .yearPalace')[0].style.left = val + '%';
                })
            })
            $(document).mouseup(function(){
                $('main .honors .box .ruler .yearPalace').attr('canmove','false');
                var val = parseFloat($('main .honors .box .ruler .yearPalace .yy')[0].style.left) - $('main .honors .box .ruler .yearPalace .yy')[0].left;
                $('main .honors .box .ruler .yearPalace')[0].left += val;
                for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                    var newLeft = parseFloat($('main .honors .box .ruler .yearPalace .yy')[l].style.left);
                    $('main .honors .box .ruler .yearPalace .yy')[l].left = newLeft;
                }
                document.onmousemove = null;
                //$('main .honors .box .ruler .yearPalace')[0].left = parseFloat($('main .honors .box .ruler .yearPalace')[0].style.left) || 0;
            })
            $('main .honors .box .years .ruler')[0].addEventListener("touchstart",function(e){
                $('main .honors .box .ruler .yearPalace').attr('canmove','true');
                var me = e || event;
                mobileStart = me.touches[0].clientX;
            })
            document.body.addEventListener("touchmove", touchRuler, {passive:false});
            function touchRuler(eve){
                if($('main .honors .box .ruler .yearPalace .yy').length <= 3) return false;
                if($('main .honors .box .ruler .yearPalace').attr('canmove') != 'true') return false;
                
                var mme = eve || window.event;
                var current = mme.touches[0].clientX;
                var distance =  current - mobileStart;
                var val = distance / $('main .honors .box .ruler .yearPalace')[0].offsetWidth * 100;
                if($('main .honors .box .ruler .yearPalace')[0].left + val < - leftMax){
                    val = - leftMax;
                    return false;
                }else if($('main .honors .box .ruler .yearPalace')[0].left + val > 0){
                    val = 0;
                    return false
                }
                for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                    var oriLeft = $('main .honors .box .ruler .yearPalace .yy')[l].left;
                    $('main .honors .box .ruler .yearPalace .yy')[l].style.left = (oriLeft + val) + '%';
                }
                //$('main .honors .box .ruler .yearPalace')[0].style.left = val + '%';
            }
            document.body.addEventListener("touchend", touchEnd, {passive:false});
            function touchEnd(){
                $('main .honors .box .ruler .yearPalace').attr('canmove','false');
                var val = parseFloat($('main .honors .box .ruler .yearPalace .yy')[0].style.left) - $('main .honors .box .ruler .yearPalace .yy')[0].left;
                $('main .honors .box .ruler .yearPalace')[0].left += val;
                for(var l = 0;l < $('main .honors .box .ruler .yearPalace .yy').length;l++){
                    var newLeft = parseFloat($('main .honors .box .ruler .yearPalace .yy')[l].style.left);
                    $('main .honors .box .ruler .yearPalace .yy')[l].left = newLeft;
                }
                //$('main .honors .box .ruler .yearPalace')[0].left = parseFloat($('main .honors .box .ruler .yearPalace')[0].style.left) || 0;
            }
           
            updateHonor();
            $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .btn').click(function(){
                var className = $(this).parent()[0].className;
                $('main .honors .box .ruler .months .current').removeClass('current');
                if(className.indexOf('prev') >= 0){
                    
                    currentMonthInd--;
                }else{
                    currentMonthInd++;
                }
                $('main .honors .box .ruler .months .item:eq(' + currentMonthInd + ')').addClass('current');
                updateHonor();
            })
            $('main .honors .box .ruler .yearPalace .yy').click(function(){
                currentYearInd = $(this)[0].ind;
                var year = $(this).text();
                for(var u = 0;u < $('main .honors .box .ruler .months .item').length;u++){
                    if($('main .honors .box .ruler .months .item:eq(' + u + ') .num').text().indexOf(year) >= 0){
                        currentMonthInd = u;
                        break;
                    }
                }
                $('main .honors .box .contn .mainContnt .lgLetter .prevOrNext .yy').removeClass('current');
                $(this).addClass('current');
                $('main .honors .box .ruler .months .item').removeClass('current');
                $('main .honors .box .ruler .months .item:eq(' + currentMonthInd + ')').addClass('current');
                updateHonor();
            })
        })